@import "./_var.less";

.avatar-size(@size, @font-size,@avatar-icon-size) {
  width: @size;
  height: @size;
  font-size: @font-size;
  line-height: @size;

  &.@{prefix}-avatar__icon {
    font-size: @avatar-icon-size;
  }
}

.avatar-group-offset-right(@offset) {
  margin-right: @offset;
}

.avatar-group-offset-left(@offset) {
  margin-left: @offset;
}

.generate-z-index(@n, @i: 1) when (@i =< @n) {

  & .@{prefix}-avatar:nth-child(@{i}) {
    z-index: (@avatar-group-init-zIndex - @i);
  }
  .generate-z-index(@n, (@i + 1));
}

.avatar-group-size--left() {
  .avatar-group-offset-left(@avatar-group-offset-medium);

  &.@{prefix}-size-s {
    .avatar-group-offset-left(@avatar-group-offset-small);
  }

  &.@{prefix}-size-l {
    .avatar-group-offset-left(@avatar-group-offset-large);
  }
}
